import java.util.Arrays;

public class Array {
    public static void main(String[] args) {
        Object[] chars=new Object[]{'i','m','f','j','j'};
        for (Object o:chars){
            System.out.println(o.toString());
        }
        System.out.println(chars);

        Object[] chars2=remove(chars,1);
        for (Object o:chars2){
            System.out.println(o.toString());
        }

    }
    private static Object[] remove(Object[] src,int index) {
        int size = src.length; //
        int numMoved = size - index - 1;//计算预删除元素右边的元素个数
        Object[] desc = new Object[]{'1','2','3','4'};//复制成新数组，去掉尾部元素
        System.arraycopy(src, index+1, desc, index, numMoved);//复制的起始位置确定好，将源数组的右边的元素贴到新数组中。
        return desc;//返回新数组
    }
}
